<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    template="/WEB-INF/templates/cp/template.xhtml">
<ui:define name="content">

<h1 class="title">我的订单</h1>

<h:dataTable value="#{orderManager.myOrders}" var="_order" border="1">
    <h:column>
        <f:facet name="header">ID</f:facet>
        <h:outputText value="#{_order.id}"/>
    </h:column>
    
    <h:column>
        <f:facet name="header">下单时间</f:facet>
        <h:outputText value="#{_order.timeCreated}">
            <f:convertDateTime pattern="yyyy-MM-dd HH:mm"/>
        </h:outputText>
    </h:column>
    
    <h:column>
        <f:facet name="header">发货状态</f:facet>
        <h:outputText value="#{_order.shipStatus}"/>
    </h:column>
    
    <h:column>
        <f:facet name="header">商品明细</f:facet>
        <ui:repeat value="#{_order.purchaseItems}" var="_item">
            <h:outputText value="#{_item.product.name}"/> x <h:outputText value="#{_item.num}"/><br/>
        </ui:repeat>
    </h:column>            
</h:dataTable>
</ui:define>
</ui:composition>
